package com.thinktank.controller;

import static com.thinktank.util.DbUtil.*;

import java.io.*;
import java.sql.*;

import javax.servlet.*;
import javax.servlet.http.*;

import com.thinktank.dao.*;
import com.thinktank.vo.*;

public class NoticeEditController implements Controller{
	public String execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
		// 번호 받고 작업해서 넘김 
		System.out.println("NoticeEditController");
		String seq=request.getParameter("seq");
		
		Connection con = getConnection();
		NoticeDao dao = new NoticeDao(con);
		Notice notice = dao.getNotice(seq);
		close(con);
		
		if(notice != null){
			request.setAttribute("notice", notice);
			request.setAttribute("ctrlr", "noticeEdit.jsp");
		}
		return "notice.jsp"; 
	}
}
